<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>认证</title>
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/main.css">
    <link rel="stylesheet" href="./css/bootstrap.min.css">
    <script src="js/jquery.min.js"></script>
    <script src="js/requestUrl.js"></script>
</head>
<style>
    .total {
        border: 1px solid #ccc;
        border-radius: 8px;
        width: 400px;
        height: auto;
        margin: 8% auto 3%;
        padding: 3% 4%;
    }

    .total h1 {
        color: #999;
        font-size: 18px;
        text-align: center;
        line-height: 30px;
    }

    .pay_Method {
        width: 54%;
        margin: 0% auto 0;
    }

    .center {
        width: 1200px;
        margin: 0 auto;
        margin-bottom: 100px;
    }

    .pay_Method ul li {
        width: 160px;
        height: 40px;
        border: none;
        position: relative;
        overflow: hidden;
    }

    #zhifubaoqrcode img,
    #weixinqrcode img {
        width: 100%;
    }

    .chooseit {
        border: 2px solid #d81e06 !important;
    }
</style>

<body>
    <!-- 头部导航 -->
    <div class="head">
        <div style="background: #006633">
            <div class="container">
                <div style="line-height: 30px;color:#fff;position: absolute;font-size:12px;">山东省足球运动协会欢迎您！</div>
                <div class="do">
                    <div class="does1" style="display: block;">
                        <a href="http://newtest.sdfa.org.cn/footballAssociation/zuxie/login.html"><span>登录</span></a>
                        |
                        <a href="http://newtest.sdfa.org.cn/footballAssociation/zuxie/register.html"><span>注册</span></a>
                    </div>
                    <div class="does2" style="display:none">
                        <span>欢迎<span id="telphone" style="margin:0"></span></span>
                        |
                        <span><a href="http://newtest.sdfa.org.cn/footballAssociation/zuxie/personal.html"
                                id="nickname">个人中心</a></span>
                        |
                        <span class="logout" style="cursor: pointer;">退出</span>
                    </div>
                </div>
            </div>
        </div>
        <div class="head-choose">
            <div class="container">
                <img src="http://newtest.sdfa.org.cn/webfile//public/headicon.png"
                    style="position: absolute;top: 15px;">
                <a href="http://newtest.sdfa.org.cn/">
                    <div class="headtext">
                        <div class="headtext1">山东省足球运动协会</div>
                        <div class="headtext2">SHANDONG FOOTBALL ASSOCIATION</div>
                    </div>
                </a>
                <div style="display:inline-block;margin-left:302px">
                    <div class="choosea">
                        <a href="http://newtest.sdfa.org.cn/index.html?id=67">
                            <div>首页</div>
                        </a>
                        <div class="choosea-2">
                        </div>
                    </div>
                    <div class="choosea">
                        <a href="http://newtest.sdfa.org.cn/notice.html?id=68">
                            <div>通知公告</div>
                        </a>
                        <div class="choosea-2">
                            <a href="http://newtest.sdfa.org.cn/notice.html?id=68&amp;item=1">
                                <div>公告规程</div>
                            </a>
                            <a href="http://newtest.sdfa.org.cn/notice.html?id=68&amp;item=2">
                                <div>政策法规</div>
                            </a>
                        </div>
                    </div>
                    <div class="choosea">
                        <a href="javascript:void(0);">
                            <div>足球专区</div>
                        </a>
                        <div class="choosea-2">
                            <a href="http://newtest.sdfa.org.cn/soccernotice.html?id=70">
                                <div>女足专区</div>
                            </a>
                            <a href="http://newtest.sdfa.org.cn/prefecture.html?id=71&item=2&child=1">
                                <div>青少年足球</div>
                            </a>
                            <a href="http://newtest.sdfa.org.cn/soccernotice.html?id=72">
                                <div>社会足球</div>
                            </a>
                        </div>
                    </div>
                    <div class="choosea">
                        <a href="http://newtest.sdfa.org.cn/otherplace.html?id=87">
                            <div>各地足协</div>
                        </a>
                        <div class="choosea-2">
                        </div>
                    </div>
                    <div class="choosea">
                        <a href="http://newtest.sdfa.org.cn/shopping/index.htm" target="_blank">
                            <div>商城</div>
                        </a>
                        <div class="choosea-2" target="_blank">
                        </div>
                    </div>
                    <div class="choosea">
                        <a href="http://newtest.sdfa.org.cn/aboutus.html?id=77">
                            <div>关于我们</div>
                        </a>
                        <div class="choosea-2">
                        </div>
                    </div>
                </div>
                <form action="result.html" method="post">
                    <div class="input-group">
                        <input type="text" name="word" value="" autocomplete="off" class="form-control"
                            placeholder="请输入您要搜索的内容">
                        <span class="glyphicon glyphicon-search" onclick="$('.head form').submit()"></span>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="clear"></div>
    <div class="center">
        <div class="total">
            <p><span>99</span>元/年</p>
            <h1>尊享山东省足协的会员权益，
                同时享有全站无限观看下载资源</h1>
        </div>
        <div class="pay">支付金额：<span>99</span>元</div>
        <div class="erweima" style="width: 160px;margin: 32px auto;display: none;">
            <div style="width:160px;height: 160px;" id="weixinqrcode"></div>
            <div style="width:160px;text-align: center;line-height: 30px;">请扫码支付</div>
        </div>
        <div class="pay_Method">
            <ul style="margin-top: 31px;">
                <li style="text-align: center;line-height: 40px;font-size: 16px;">
                    请选择支付方式：
                </li>
                <li style="text-align: center;" class="weixin">
                    <img src="./img/weixin.jpg" alt="" style="width: 135px;height: 40px;cursor: pointer;">
                    <img class="littlechoose" src="./img/xuanzhong.png" alt=""
                        style="position: absolute;right: -1px;bottom: -1px;width: 18px;display: none;">
                </li>
                <li style="text-align: center;" class="zhifubao">
                    <img src="./img/zhifubao.jpg" alt=""
                        style="width: 90px;height: 28px;margin-top: 4px;cursor: pointer;">
                    <img class="littlechoose" src="./img/xuanzhong.png" alt=""
                        style="position: absolute;right: -1px;bottom: -1px;width: 18px;display: none;">
                </li>
                <li style="text-align: center;">
                    <div id="paysure"
                        style="width: 103px;height: 40px;margin: 0 auto;line-height: 40px;background: #d81e06;color: #fff;text-align: center;cursor: pointer;">
                        立即支付
                    </div>
                </li>
            </ul>

        </div>
    </div>


    <!-- 底部 -->
    <div class="footer" style="min-width: 100%;">
        <div>
            版权所有：山东省足球运动协会官方网站
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            ICP经营许可证：鲁ICP备15020327号
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            山东乐体网络科技有限公司
        </div>
    </div>
    <script src="js/qrcode.min.js"></script>
    <script src="js/layer/layer.js"></script>

    <script>
        var global_userId = sessionStorage.userId
        var global_nickName = sessionStorage.nickName;
        var global_tel = sessionStorage.tel;
        $("#telphone").text(global_tel)
        if (global_userId) {
            $('.do .does1').css('display', 'none')
            $('.do .does2').css('display', 'block')
        } else if (global_nickName == undefined || global_nickName == "") {
            $('.do .does1').css('display', 'block')
            $('.do .does2').css('display', 'none')
        }
        //退出
        $('.logout').click(function () {
            myAjax('/user/logout', {},
                function (data) {
                    console.log(data)
                    if (data.msg == 0) {
                        sessionStorage.clear()
                        location.reload()
                    }
                },
                function (err) {
                    console.log(err)
                })
        });
        $(".weixin").on("click", function () {
            $(".zhifubao").removeClass("chooseit")
            $(".weixin").addClass("chooseit")
            $(".weixin .littlechoose").css("display", "block")
            $(".zhifubao .littlechoose").css("display", "none")
        })
        $(".zhifubao").on("click", function () {
            $(".weixin").removeClass("chooseit")
            $(".zhifubao").addClass("chooseit")
            $(".zhifubao .littlechoose").css("display", "block")
            $(".weixin .littlechoose").css("display", "none")
        })
        var ip = "http://newtest.sdfa.org.cn";
        // var ip = "http://192.168.0.160:8083"


        $("#paysure").on("click", function () {
            if (!$(".zhifubao").hasClass("chooseit") && !$(".weixin").hasClass("chooseit")) {
                layer.msg("请选择支付方式")
                return false
            } else if ($("#weixinqrcode").children().length == 0) {
                if ($(".zhifubao").hasClass("chooseit")) {
                    $.ajax({ //请求
                        type: "POST",
                        url: ip + "/footballAssociation/alipay/creatAlipayUrl",
                        dataType: "JSON",
                        success: function (res) {
                            if (res.msg == "您当前暂未登录，请登录后在操作") {
                                layer.alert(res.msg, {
                                    title: "提示",
                                    cancel: function () {
                                        window.location.href =
                                            "http://newtest.sdfa.org.cn/footballAssociation/zuxie/login.html"
                                    }
                                }, function () {
                                    window.location.href =
                                        "http://newtest.sdfa.org.cn/footballAssociation/zuxie/login.html"
                                });
                                return false
                            }
                            if (res.msg == 0) {
                                new QRCode(document.getElementById("weixinqrcode"), res.url);
                                $(".erweima").css("display", "block")
                                var timeout = setInterval(function () {
                                    $.ajax({ //请求
                                        type: "POST",
                                        url: ip +
                                            "/footballAssociation/alipay/getPaymentStatus",
                                        data: {
                                            orderNum: res.orderNum
                                        },
                                        dataType: "JSON",
                                        success: function (back) {
                                            if (back.msg == 0) {
                                                clearInterval(timeout)
                                                layer.alert("支付成功", {
                                                    title: "提示",
                                                    cancel: function () {
                                                        window
                                                            .location
                                                            .href =
                                                            ip +
                                                            "/footballAssociation/zuxie/personal.html"
                                                    }
                                                }, function () {
                                                    window.location
                                                        .href =
                                                        ip +
                                                        "/footballAssociation/zuxie/personal.html"
                                                })
                                            } else if (back.msg == 1) {} else {
                                                clearInterval(timeout)
                                                layer.msg(back.msg)
                                            }
                                        }
                                    });
                                }, 5000)
                            } else {
                                layer.msg(res.msg)
                            }
                        }
                    });
                } else if ($(".weixin").hasClass("chooseit")) {
                    $.ajax({ //微信
                        type: "POST",
                        url: ip + "/footballAssociation/wxPay/weixinPay",
                        dataType: "JSON",
                        success: function (res) {
                            if (res.msg == "您当前暂未登录，请登录后在操作") {
                                layer.alert(res.msg, {
                                    title: "提示",
                                    cancel: function () {
                                        window.location.href =
                                            "http://newtest.sdfa.org.cn/footballAssociation/zuxie/login.html"
                                    }
                                }, function () {
                                    window.location.href =
                                        "http://newtest.sdfa.org.cn/footballAssociation/zuxie/login.html"
                                });
                                return false
                            }
                            if (res.msg == 0) {
                                new QRCode(document.getElementById("weixinqrcode"), res
                                    .packageParams.code_url);
                                $(".erweima").css("display", "block")
                                var timeout = setInterval(function () {
                                    $.ajax({ //微信
                                        type: "POST",
                                        url: ip +
                                            "/footballAssociation/alipay/getPaymentStatus",
                                        data: {
                                            orderNum: res.orderNum
                                        },
                                        dataType: "JSON",
                                        success: function (back) {
                                            if (back.msg == 0) {
                                                clearInterval(timeout)
                                                layer.alert("支付成功", {
                                                    title: "提示",
                                                    cancel: function () {
                                                        window
                                                            .location
                                                            .href =
                                                            ip +
                                                            "/footballAssociation/zuxie/personal.html"
                                                    }
                                                }, function () {
                                                    window.location
                                                        .href =
                                                        ip +
                                                        "/footballAssociation/zuxie/personal.html"
                                                })
                                            } else if (back.msg == 1) {} else {
                                                clearInterval(timeout)
                                                layer.msg(back.msg)
                                            }
                                        }
                                    });
                                }, 5000)
                            } else {
                                layer.msg(res.msg)
                            }
                        }
                    });
                }
            } else {
                layer.msg("请勿重复生成订单，请刷新后再试")
            }
        })
        // myAjax('/alipay/creatAlipayUrl', {},
        //     function (data) {
        //         console.log(data)
        //         if (data.msg == 0) {
        //             sessionStorage.clear()
        //             location.reload()
        //         }
        //     },
        //     function (err) {
        //         console.log(err)
        //     })
    </script>
</body>

</html>